
$(function(){
		$("#main_head").load("head.html?_="+Math.random())
		$("#main_fooster").load("fooster.html?_="+Math.random())
		
		timer = setInterval(star,3000);
		var index = 0;
		$("#banner .ban_list li").eq(0).css('opacity',1)
		$("#banner .Sban_list li").eq(index).css("background","red")
		function star(){
			index ++
			if(index==5){
				index = 0	
			}
			$("#banner .ban_list li").stop().animate({"opacity":0},50).eq(index).animate({"opacity":1},500)
			$("#banner .Sban_list li").css("background","#666").eq(index).css("background","red")
		}
		
		$("#banner .Sban_list li").mouseover(function(){
			console.log("ss")
			clearInterval(timer)
			index = $(this).index() - 1;
			star();
			timer = setInterval(star,3000);
		})
		
		$("#banner .turn_right").click(function(){
			clearInterval(timer)
			star();
			timer = setInterval(star,3000);
		})
		$("#banner .turn_left").click(function(){
			clearInterval(timer)
			
			index =index - 2;
			console.log(index)
			if(index<-1){
				index = 3;
			}
			
			star();
			timer = setInterval(star,3000);
		})
})